Skip to content

Conversation

henrikac
Copy link
Contributor

This PR adds the Monte Carlo methods in Crystal.

@henrikac
Copy link
Contributor Author

[lang: crystal]

@Amaras Amaras added Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) hacktoberfest-accepted labels Oct 21, 2021
@Andriamanitra
Copy link

Perhaps more idiomatic way to count points inside the circle would be

pi_count = n.times.count do
  in_circle(rand, rand)
end

but other than that the code looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) lang: crystal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants